<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
</head>
<body>
    <!-- 求1!+2!+3!+...+10!的和。（阶乘） -->
    
    <script>

        var num1 = 0;
        var num2 = 1;
        for(var i = 1; i<=10; i++){
            num2 = num2*i;
            num1 += num2;
        }
        document.write(num1);

    </script>

</body>
</html>